home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Online / Apache / lib / php / build / dynlib.m4 < prev    next >
Encoding:
M4 Source File  |  2001-03-06  |  3.3 KB  |  89 lines

  1. #  +----------------------------------------------------------------------+
  2. #  | PHP version 4.0                                                      |
  3. #  +----------------------------------------------------------------------+
  4. #  | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group                   |
  5. #  +----------------------------------------------------------------------+
  6. #  | This source file is subject to version 2.02 of the PHP license,      |
  7. #  | that is bundled with this package in the file LICENSE, and is        |
  8. #  | available at through the world-wide-web at                           |
  9. #  | http://www.php.net/license/2_02.txt.                                 |
  10. #  | If you did not receive a copy of the PHP license and are unable to   |
  11. #  | obtain it through the world-wide-web, please send a note to          |
  12. #  | license@php.net so we can mail you a copy immediately.               |
  13. #  +----------------------------------------------------------------------+
  14. #  | Authors: Sascha Schumann <sascha@schumann.cx>                        |
  15. #  +----------------------------------------------------------------------+
  16. #
  17. # $Id: dynlib.m4,v 1.5 2000/10/30 14:29:51 sas Exp $ 
  18. #
  19.  
  20.  
  21.  
  22. AC_DEFUN(LIB_SHARED_CONVENIENCE,[
  23.   lib_target="\$(LTLIBRARY_NAME)"
  24.   cat >>$1<<EOF
  25. \$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
  26.     \$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \[$]@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
  27.  
  28. EOF
  29. ])
  30.  
  31. AC_DEFUN(LIB_SHARED_MODULE,[
  32.   lib_target="\$(LTLIBRARY_SHARED_NAME)"
  33.   cat >>$1<<EOF
  34. \$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
  35.     \$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \[$]@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
  36.     \$(SHARED_LIBTOOL) --mode=install cp \[$]@ \$(phplibdir)
  37.  
  38. EOF
  39. ])
  40.  
  41. AC_DEFUN(LIB_STATIC_CONVENIENCE,[
  42.   lib_target="\$(LTLIBRARY_NAME)"
  43.   cat >>$1<<EOF
  44. \$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
  45.     \$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)
  46.  
  47. EOF
  48. ])
  49.  
  50. dnl LIB_BUILD(path, shared, convenience)
  51. dnl sets up path to build a shared/static convenience/module
  52. AC_DEFUN(LIB_BUILD,[
  53.   lib_makefile="$1/libs.mk"
  54.   lib_target=""
  55.   
  56.   $php_shtool mkdir -p $1
  57.   if test "$BSD_MAKEFILE" = "yes"; then
  58.     lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  59.   else
  60.     lib_include_conf="include \$(top_builddir)/config_vars.mk"
  61.   fi
  62.   cat >$lib_makefile<<EOF
  63. $lib_include_conf
  64. LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
  65. LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
  66. EOF
  67.  
  68.   if test "$2" = "shared" || test "$2" = "yes"; then
  69.     lib_build_shared=yes
  70.     if test -n "$3"; then
  71. dnl ---------------------------------------- Shared Convenience
  72.       LIB_SHARED_CONVENIENCE($lib_makefile)
  73.     else
  74. dnl ---------------------------------------- Shared Module
  75.       LIB_SHARED_MODULE($lib_makefile)
  76.     fi
  77.   else
  78. dnl ---------------------------------------- Static Convenience = Static Module
  79.     LIB_STATIC_CONVENIENCE($lib_makefile)
  80.   fi
  81.  
  82. dnl ---------------------------------------- Generate build targets
  83.   if test -n "$lib_target"; then
  84.     cat >>$lib_makefile<<EOF
  85. targets = $lib_target
  86. EOF
  87.   fi
  88. ])
  89.